package com.heima.admin.feign;

import com.heima.admin.dto.NewsAuthDto;
import com.heima.admin.dto.WmNews;
import com.heima.admin.dto.WmUser;
import com.heima.admin.vo.WmNewsVo;
import com.heima.common.dto.PageResponseResult;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("leadnews-wemedia")
public interface WeMediaFeign {

    @GetMapping("/api/v1/news/{id}")
    @ApiOperation(value = "查看文章", notes = "author:mcm")
    public ResponseResult<WmNews> getById(@PathVariable Integer id);

    @PutMapping("/api/v1/news")
    @ApiOperation(value = "修改文章", notes = "author:mcm")
    public ResponseResult updateById(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/user/{id}")
    @ApiOperation(value = "查询自媒体人", notes = "author:mcm")
    public ResponseResult<WmUser> findUserById(@PathVariable Integer id);

    @GetMapping("/api/v1/news/getRelease")
    @ApiOperation(value = "查询待发布文章状态", notes = "author:mcm")
    public ResponseResult<List<Integer>> getRelease();

    @PostMapping("/api/v1/news/findPageByName")
    @ApiOperation(value = "查询人工审核文章", notes = "author:mcm")
    public PageResponseResult findPageByName(@RequestBody NewsAuthDto dto);

    @GetMapping("/api/v1/news/findNewsVoById/{id}")
    @ApiOperation(value = "查询审核文章", notes = "author:mcm")
    public ResponseResult<WmNewsVo> findNewsVoById(@PathVariable("id") Integer id);
}
